package cn.amebius.util;

import com.github.dockerjava.api.DockerClient;
import com.github.dockerjava.api.model.Info;
import com.github.dockerjava.core.DockerClientBuilder;


/**
 * @author 阿伟
 * @date 2023/7/21 12:02
 */
public class DockerClientUtil {
     static DockerClient dockerClient;

     static String containerId = "767a13d178e9"; //容器ID

    static {
        dockerClient = DockerClientBuilder.getInstance("tcp://192.168.121.140:2376").build();
        Info info = dockerClient.infoCmd().exec();
        System.out.println("【Docker环境】");
        System.out.print(info);
    }

    public static DockerClient getDockerClient() {
        return dockerClient;
    }

    public static String getContainerId() {
        return containerId;
    }

    public static void setContainerId(String s) {
        containerId = s;
    }

    public static void setDockerClient(DockerClient newDockerClient) {
        dockerClient = newDockerClient;
    }
}
